# 8的倍数全都不对. 我蒙掉了.
primes = []
spf = [i for i in range(0, 1010)]

def sieve(size=1010):
    for i in range(2, size):
        if spf[i]==i:
            for j in range(i*i, size, i):
                spf[j] = i
    for i in range(2, size):
        if spf[i]==i:
            primes.append(i)

def factorize(x):
    res = []
    while x>1:
        res.append(spf[x])
        x //= spf[x]
    return res

sieve()
while True:
    try:
        f = factorize(int(input()))
        f.sort(reverse=True)
        ans = 1
        for a, b in zip(primes, f):
            ans *= a**(b-1)
        print(ans)
    except:
        break